﻿using HamcoWcs.Entitys.Bases;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace HamcoWcs.Entitys.Devices
{
    public class SrmInfo : BaseEntity
    {
        public string SrmName { get; set; }
        // ppk add
        public string MachineName { get; set; }
        // ppk add
        public string PortName { get; set; }
        public string PlcName { get; set; }
        public int SendStartPoint { get; set; }
        public int RecvStartPoint { get; set; }
    }



    public class SrmInfoConfig : IEntityTypeConfiguration<SrmInfo>
    {
        public void Configure(EntityTypeBuilder<SrmInfo> builder)
        {
            builder.HasComment("堆垛机信息表");
            builder.Property(x => x.SrmName).IsRequired().HasMaxLength(30).HasComment("堆垛机名");
            builder.Property(x => x.MachineName).HasDefaultValue("").HasMaxLength(50).HasComment("机器名");
            builder.Property(x => x.PortName).HasDefaultValue("").HasMaxLength(50).HasComment("端口名");

            builder.Property(x => x.PlcName).IsRequired().HasMaxLength(30).HasComment("PLC名");

            builder.Property(x => x.SendStartPoint).HasComment("发送DB偏移量");
            builder.Property(x => x.RecvStartPoint).HasComment("接收DB偏移量");
        }
    }
}
